﻿using System.ComponentModel;

namespace UIPrototyper
{
    [DefaultPropertyAttribute("Conteudo")]
    public class LabelProperties : Property, IChanged
    {
        private CustomLabel label;

        public LabelProperties(CustomLabel pLabel)
        {
            this.label = pLabel;
        }

        [DescriptionAttribute("O nome da Label"),
        CategoryAttribute("Label")]
        public override string Nome
        {
            get { return this.label.Name; }
            set { this.label.Name = value; LaunchChangedEvent(this.label); }
        }

        [DescriptionAttribute("O conteúdo que será apresentado pela Label."),
        CategoryAttribute("Label")]
        public string Conteudo
        {
            get { return this.label.Content.ToString(); }
            set { this.label.Content = value; LaunchChangedEvent(this.label); }
        }

        #region IChanged Members

        public event ChangedHandler iChanged;

        public void LaunchChangedEvent(IChanged pChangedObject)
        {
            if (iChanged != null)
            {
                iChanged(pChangedObject);
            }
        }

        #endregion
    }
}
